function createNotice(title, notice, showByDefault)
{
    if (showByDefault === undefined)
        showByDefault = true;

    if (title === undefined)
        throw new Error("Title must be defined!");

    if (notice === undefined)
        throw new Error("Notice parameter in createNotice() must be defined!");

    document.write('<div class="notice">');
    document.write('<div class="header">');
    document.write('<div class="title">');
    document.write(title)
    document.write('</div>');
    document.write('<div class="javascriptHide">');
    if (showByDefault != true)
        document.write('<a onclick="return false;"><img src="../images/notice/show.png" alt="Show Notice" onclick="toggleImage(this, \'' + title + '\');" /></a>');
    else
        document.write('<a onclick="return false;"><img src="../images/notice/hide.png" alt="Hide Notice" onclick="toggleImage(this, \'' + title + '\');" /></a>');
    document.write('</div>');
    document.write('</div>');
    document.write('<div class="body" id="' + title + '">');
    document.write(notice);
    document.write('</div>');
    document.write('</div>');

    if (showByDefault != true)
        document.getElementById(title).style.display = 'none';
}

function toggleImage(element, id)
{
    var stringSource = String(element.src);
    if (stringSource.slice(stringSource.length - 8) == "hide.png")
    {
        element.src = "../images/notice/show.png";
        element.alt = "Show Notice";
        document.getElementById(id).style.display = 'none';
    }
    else
    {
        element.src = "../images/notice/hide.png";
        element.alt = "Hide Notice";
        document.getElementById(id).style.display = 'block';
    }
}